<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        width: 200px;
        height: 200px;
        background-color: pink;
        border: 10px solid red;
        padding: 10px;
      }
    </style>
  </head>
  <body>
    <div></div>
    <script>
      //client 宽度 和我们offseWidth  最大的区别就是不包含边框
      var div = document.querySelector('div');
      console.log(div.clientWidth); //盒子加padding距离 220
    </script>
  </body>
</html>
